home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-11 / drivel.zip / GETDRIVE.C < prev    next >
Text File  |  1993-01-04  |  1KB  |  38 lines

  1. /* getdrive.c                                */
  2. /* compile with MSC 5.0 or above:            */
  3.  
  4. /* cl /c /AL /Zl /FPa /Gs /Ox /W3 getdrive.c */
  5.  
  6. #include "nandef.h"                 /* Nantucket C define's        */
  7. #include "extend.h"                 /* Clipper Extend declarations */
  8.  
  9. extern char DriveLtr(void);         /* Microsoft ASM routine       */
  10. CLIPPER GetDrive(void);
  11.  
  12. /*
  13.     Function:       GetDrive
  14.     Parameters:     None
  15.     Returns:        char * - the current drive letter using the Clipper
  16.                                Summer 87 methods
  17.     Author:         Mike Taylor
  18.     Date:           16 December 1988
  19.  
  20.     Description:    Returns to a Clipper caller the current drive letter
  21.  
  22.     Called By:      Clipper Summer 87 code
  23. */
  24.  
  25. CLIPPER GetDrive()
  26. {
  27.     char DriveStr[3];
  28.  
  29.     /* get the current drive code from DOS and set up the return string     */
  30.  
  31.     DriveStr[0] = DriveLtr() + 'A';     /* convert to uppercase letter by   */
  32.                                         /*   decimal 65 to the drive code   */
  33.     DriveStr[1] = ':';
  34.     DriveStr[2] = '\0';
  35.  
  36.     _retc( DriveStr );
  37. }
  38.